//
//  WebViewViewController.m
//  FreshMember
//
//  Created by qyc on 2019/4/28.
//  Copyright © 2019年 qyc. All rights reserved.
//

#import "WebViewViewController.h"

#import "LoadingView.h"
@interface WebViewViewController ()

@end

@implementation WebViewViewController

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:YES];
    //    [LoadingView removeLoadingView];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self configDefaultNavigationTitle:self.titles isLine:YES];
    
    NSURL *url = [NSURL URLWithString:self.url];
    self.webView.scalesPageToFit = NO;
    self.webView.opaque = NO;
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    [self.webView loadRequest:request];
    [self.view addSubview:self.webView];
}

#pragma mark - UIWebViewDelegate
- (BOOL)webView: (UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    NSURL *url = [request URL];
    NSLog(@"%@, %@", [url scheme], url);
    return YES;
}

#pragma mark - UIWebViewDelegate
/**
 *  UIWebView开始加载资源的时候调用(开始发送请求)
 */
- (void)webViewDidStartLoad:(UIWebView *)webView {

}

/**
 *  UIWebView加载完毕的时候调用(请求完毕)
 */
- (void)webViewDidFinishLoad:(UIWebView *)webView {

}

/**
 *  UIWebView加载失败的时候调用(请求失败)
 */
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
